﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IDAL;
using Models;

namespace DAL
{
    public class PageIndexDAL:IPageIndex
    {
        public List<PageIndexInfo> GetPageIndexInfo(int PageCount, int NowPage,int CategoryID)
        {
            List<PageIndexInfo> list = new List<PageIndexInfo>();
            for (int i = 0; i < PageCount; i++)
            {
                PageIndexInfo pageindex = new PageIndexInfo();
                pageindex.PageIndex = i + 1;
                pageindex.CategoryID = CategoryID;
                if (i == (NowPage - 1))
                {
                    pageindex.NowPage = "now";
                }
                else
                {
                    pageindex.NowPage = "";
                }
                list.Add(pageindex);
            }
            return list;
        }
    }
}
